package com.hbnu.personaldiaryweb.entity;

import java.util.Objects;

public class Diary {

    String id;

    String user_id;

    String title;

    String diary_body;

    String date_time;

    String label;

    String life_state;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDiary_body() {
        return diary_body;
    }

    public void setDiary_body(String diary_body) {
        this.diary_body = diary_body;
    }

    public String getDate_time() {
        return date_time;
    }

    public void setDate_time(String date_time) {
        this.date_time = date_time;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getLife_state() {
        return life_state;
    }

    public void setLife_state(String life_state) {
        this.life_state = life_state;
    }

    public Diary() {
    }

    public Diary(String id, String user_id, String title, String diary_body, String date_time, String label, String life_state) {
        this.id = id;
        this.user_id = user_id;
        this.title = title;
        this.diary_body = diary_body;
        this.date_time = date_time;
        this.label = label;
        this.life_state = life_state;
    }

    @Override
    public String toString() {
        return "diary{" +
                "id='" + id + '\'' +
                ", user_id='" + user_id + '\'' +
                ", title='" + title + '\'' +
                ", text='" + diary_body + '\'' +
                ", date_time='" + date_time + '\'' +
                ", label='" + label + '\'' +
                ", life_state='" + life_state + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        Diary diary = (Diary) object;
        return Objects.equals(id, diary.id) && Objects.equals(user_id, diary.user_id) && Objects.equals(title, diary.title) && Objects.equals(diary_body, diary.diary_body) && Objects.equals(date_time, diary.date_time) && Objects.equals(label, diary.label) && Objects.equals(life_state, diary.life_state);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, user_id, title, diary_body, date_time, label, life_state);
    }
}
